package kr.hkit.PowerJava.chapter11;
class Fly{
	String name;

	@Override
	public String toString() {
		return name;
	}
	
	
}
public class Car {
	int speed;
	int gear;
	public String color;

	public void speedUp(int increment) {
		speed += increment;

	}

	public void speedDown(int decrement) {
		speed -= decrement;
	}

	@Override
	public String toString() {
		return String.format("Object[%s] -> Car [%s, %s, %s]",
				super.toString(),speed, gear, color);
	}

	public static void main(String[] args) {
		Car car = new Car();
		car.gear = 1;
		car.color = "Red";
		car.speedUp(60);
	    
		Car car2 = new Car();
		car2.gear = 2;
		car2.color = "Blue";
		car2.speedUp(80);
		
		Fly fly = new Fly();
		fly.name = "fly01";
		
		Fly fly2 = new Fly();
		fly2.name = "fly02";
		
		Car[] arrCar = new Car[2];
		Fly[] arrFlay = new Fly[2];
		
		arrCar[0] = car;
		arrCar[1] = car2;
		
		arrFlay[0] = fly;
		arrFlay[1] = fly2;
		
		prnArr(arrCar);
		prnArr(arrFlay);
		
			
		
		/*	System.out.println(car);

        Object obj = car;
        System.out.println(obj.toString());*/
        
       // Car car2 = new Object;
        
	
	}

	private static void prnArr(Fly[] arrFlay) {
		// TODO Auto-generated method stub
		
	}

	private static void prnArr(Car[] arrCar) {
		// TODO Auto-generated method stub
		
	}
}
